package org.bultreebank.search_engine.integration;

import org.w3c.dom.Document;


public interface SearchEngine extends org.bultreebank.search_engine.SearchEngine
{
	/**
	 * Returns a list of matching to the query context and document identifiers
	 * @param queryDoc - query document
	 * @param indexID - index identifier
	 * @return
	 * @throws Exception
	 */
	public String[] search(Document queryDoc, String indexID) throws Exception;
	/**
	 * Creates an empty index with schema specified as an argument
	 * @param indexingSchemaDocument 
	 * @throws Exception
	 */
	public void registerIndex(Document indexingSchemaDocument)
	throws Exception;
	
	/**
	 * Adds the XML document to the index and the document repository if
	 * it exists.
	 * @param xmlDocument - XML document to index
	 * @param metadataDocument - additional data for the XML document to 
	 * index
	 * @param index - user defined index ID
	 * @param docID - an explicitly defined doc ID
	 * @throws Exception
	 */
	public void  indexDocument(
			Document xmlDocument, Document metadataDocument, String indexID, 
			String docID)
	throws Exception;

	/**
	 * Adds the document with the specified document ID to the specified index
	 * @param docID - document ID of a document available in the Search
	 *  Engine Document Repository if it exists 
	 * @param index - user defined indexID
	 * @throws Exception
	 */
	public void indexDocument(String docID, Document metadataDoc, 
			String indexID) throws Exception;
	
}
